package com.ces.knacky.model;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang.builder.EqualsBuilder;

import com.ces.knacky.framework.model.AbstractEntity;

/** @author Hibernate CodeGenerator */
public class TransactionTable extends AbstractEntity implements Serializable {

    /** nullable persistent field */
    private Float amount;

    /** nullable persistent field */
    private com.ces.knacky.model.PaymentStatus paymentStatus;

    /** persistent field */
    private com.ces.knacky.model.OrderTable order;

    /** persistent field */
    private com.ces.knacky.model.UserTable user;

    /** full constructor */
    public TransactionTable(Date createTime, Date updateTime, Float amount, com.ces.knacky.model.PaymentStatus paymentStatus, com.ces.knacky.model.OrderTable order, com.ces.knacky.model.UserTable user) {
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.amount = amount;
        this.paymentStatus = paymentStatus;
        this.order = order;
        this.user = user;
    }

    /** default constructor */
    public TransactionTable() {
    }

    /** minimal constructor */
    public TransactionTable(com.ces.knacky.model.OrderTable order, com.ces.knacky.model.UserTable user) {
        this.order = order;
        this.user = user;
    }

    public Float getAmount() {
        return this.amount;
    }

    public void setAmount(Float amount) {
        this.amount = amount;
    }

    public com.ces.knacky.model.PaymentStatus getPaymentStatus() {
        return this.paymentStatus;
    }

    public void setPaymentStatus(com.ces.knacky.model.PaymentStatus paymentStatus) {
        this.paymentStatus = paymentStatus;
    }

    public com.ces.knacky.model.OrderTable getOrder() {
        return this.order;
    }

    public void setOrder(com.ces.knacky.model.OrderTable order) {
        this.order = order;
    }

    public com.ces.knacky.model.UserTable getUser() {
        return this.user;
    }

    public void setUser(com.ces.knacky.model.UserTable user) {
        this.user = user;
    }

    public boolean equals(Object other) {
        if ( !(other instanceof TransactionTable) ) return false;
        TransactionTable castOther = (TransactionTable) other;
        return new EqualsBuilder()
            .append(this.getId(), castOther.getId())
            .isEquals();
    }
}
